<?php echo $this->start('sidebar'); ?>
<div id="left" class="widget">
	<div class="title">
		<h3>分类导航</h3>
	</div>
	<div class="content">
		<?php echo $this->element('widget.categories', compact('categories', 'inflector'));?>
	</div>
</div>
<?php echo $this->end(); ?>

<div id="right" class="widget">

	<div class="title">
		<h3><?php echo $title;?></h3>
	</div>

	<div class="content">
		<?php if (!empty($downloads)): ?>

			<ul class="news">
			<?php $i = 0; foreach ($downloads as $download): ?>
				<li>
					<span class="date"><?php echo substr($download['Download']['publish_date'], 0, 10); ?></span>
					<span class="label label-info"><?php echo strtoupper(pathinfo($download['Attachment'][0]['basename'], PATHINFO_EXTENSION)); ?></span>
					<?php echo $this->Html->link(h($download['Download']['title']), array('action' => 'download', $download['Download']['id'])); ?>
				</li>
			<?php endforeach; ?>
			</ul>

			<?php echo $this->element('paginator'); ?>

		<?php else: ?>

			<div class="alert alert-info">
				<a class="close" data-dismiss="alert">×</a>
				<strong><?php echo __('Oops');?>!</strong>&nbsp;&nbsp;<?php echo __('No data found!');?>
			</div>

		<?php endif; ?>
	</div>

</div>
